package com.cloudcc.mobile.dao.impl;


import com.cloudcc.cloudframe.net.async.AsyncClient;
import com.cloudcc.mobile.AppContext;
import com.cloudcc.mobile.dao.ModuleDao;
import com.cloudcc.mobile.util.NetWork;
import com.cloudcc.mobile.util.Tools;
import com.cloudcc.mobile.util.UrlTools;
import com.loopj.android.http.RequestHandle;
import com.loopj.android.http.RequestParams;

public class ModuleDaoImpl implements ModuleDao{

	@Override
	public String getModules() {
		try {
			String url=UrlTools.url+UrlTools.url_path+"serviceName=getAppAndTabList&binding="+AppContext.binding;
			String jsonString=NetWork.get(url.trim());
			return jsonString;
		} catch (Exception e) {
			Tools.handle(e);
		}
		return null;
	}

	@Override
	public RequestHandle getModules_w() {
		RequestParams params = new RequestParams();
		String url=UrlTools.url+UrlTools.url_path+"serviceName=getAppAndTabList&binding="+AppContext.binding;
		return AsyncClient.getInstance().get(url, params, null);
	}

}
